# *_*coding:utf-8 *_*
class Student:
    # 定义类成员属性
    name = None
    gender = None
    age = 0

    def __init__(self, name, gender, age):
        self.name = name
        self.gender = gender
        self.age = age


stu = Student("zsx", "man", 18)
print(f'姓名:{stu.name}, 性别:{stu.gender}, 年龄:{stu.age}')




# *_*coding:utf-8 *_*
class Phone:
    id = 1

    def call_5g(self):
        print("使用5g通话")


class MyPhone(Phone):
    id = 2

    # 子类对父类的方法进行重写
    def call_5g(self):
        print("使用升级5g通话")
        # 方式一：调用父类成员
        print(f'父类id:{Phone.id}')
        print(f'父类id:{Phone.call_5g(self)}')
        # 方式二：调用父类成员
        print(f'父类id:{super().id}')
        print(f'父类id:{super().call_5g()}')


my_phone = MyPhone()
my_phone.call_5g()



# *_*coding:utf-8 *_*
# 基础数据类型注解
var1: int = 10
var2: float = 3.12
var3: bool = True
var4: str = "sgfdghs"


class Student:
    pass


# 类对象类型注解
stu: Student = Student()

# 基础容器类型注解
my_list: list = [1, 2, 3]
my_tuple: tuple = (1, 2, 3)
my_set: set = {1, 2, 3}
my_dict: dict = {"a": 1}
my_str: str = "dhsdjs"

# 容器类型详细注解
my_list1: list[int] = [1, 2, 3]
my_tuple1: tuple[int, bool, str] = (1, True, "dsd")
my_set1: set[int] = {1, 2, 3}
my_dict1: dict[str, int] = {"a": 1}
